package pl.edu.agh.ros.proxy;

import org.ros.RosCore;
import org.ros.node.DefaultNodeRunner;
import org.ros.node.NodeConfiguration;
import org.ros.node.NodeRunner;

public class Main {

	private final static NodeRunner nodeRunner = DefaultNodeRunner.newDefault();
	private static ProxyTalker talker;
	private static Listener listener;

	/**
	 * @param args
	 * @throws InterruptedException
	 */
	public static void main(String[] args) throws InterruptedException {
		RosCore rosCore = RosCore.newPrivate(3333);
		NodeConfiguration nodeConfiguration = NodeConfiguration.newPrivate();
		nodeRunner.run(rosCore, nodeConfiguration);
		rosCore.awaitStart();
		nodeConfiguration.setMasterUri(rosCore.getUri());
		talker = new ProxyTalker();
		nodeRunner.run(talker, nodeConfiguration);
		listener = new Listener();
		nodeRunner.run(listener, nodeConfiguration);
	}

}
